import React, { Component } from 'react';
import TransferToChild11 from './Child1的子组件'
import { glabalContext } from './common/js/globalData'
const { Consumer } = glabalContext
class TransferToChild1 extends Component {
    render() { 
        return (<div>
        子组件child1: 
        {/* 读取父组件的role数据 */}
          <TransferToChild11 />
           <Consumer>
              {
               value => (<div>
               {value.email}
               <button onClick={() => value.updateRole('wangwu')}>修改role</button>
               </div>)
              }
           </Consumer>
           {/* 插槽传来的内容 */}
           {  this.props.children }
           {/* footer内容 */}<br/>
           具名插槽：footer
           {
             this.props.footer
           }
        </div>);

    }
}
 
export default TransferToChild1;